.NET Framework Class Library |
ParallelEnumerable..::.OrderByDescending<(Of <(TSource, TKey>)>) Method (ParallelQuery<(Of <(TSource>)>), Func<(Of <(TSource, TKey>)>)) |
ParallelEnumerable Class See Also Send Feedback |
Sorts in parallel the elements of a sequence in descending order according to a key.
Namespace:
System.Linq
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Shared Function OrderByDescending(Of TSource, TKey) ( _ source As ParallelQuery(Of TSource), _ keySelector As Func(Of TSource, TKey) _ ) As OrderedParallelQuery(Of TSource) |
C# |
---|
public static OrderedParallelQuery<TSource> OrderByDescending<TSource, TKey>( ParallelQuery<TSource> source, Func<TSource, TKey> keySelector ) |
Parameters
- source
- Type: System.Linq..::.ParallelQuery<(Of <(TSource>)>)
A sequence of values to order.
- keySelector
- Type: System..::.Func<(Of <(TSource, TKey>)>)
A function to extract a key from an element.
Type Parameters
- TSource
- The type of elements of source.
- TKey
- The type of the key returned by keySelector.
Return Value
An OrderedParallelQuery{TSource} whose elements are sorted descending according to a key.Remarks
In contrast to the sequential implementation, this is not a stable sort.
See the remarks for OrderBy(ParallelQuery{TSource}, Func{TSource,TKey}) for
an approach to implementing a stable sort.
Exceptions
Exception | Condition |
---|---|
System..::.ArgumentNullException | source or keySelector is a null reference (Nothing in Visual Basic). |